{% extends 'AdminsBundle:base:main.content.lists.div.html.twig' %}
{% block options %}
    <div class="menu-list">
        <div class="rule-single-select">
            <select name="cond[cid]" onchange="javascript:__doPostBack('searchCond','')" >
                <option value="" {{app.request.get("cond").cid is defined and app.request.get("cond").cid == "" ? ' selected="selected"' : "" }} >请选择分类</option>
                {% for class in classes %}
                    <option value="{{ class.id }}" {{app.request.get("cond").cid is defined and  app.request.get("cond").cid == class.id ? ' selected="selected"' : "" }} >{{ class.name }}</option>
                {% endfor %}
            </select>
        </div>
        <div class="rule-single-select">
            <select name="cond[isIndex]" onchange="javascript:__doPostBack('searchCond','')" >
                <option value="" {{app.request.get("cond").isIndex is defined and app.request.get("cond").isIndex == "" ? ' selected="selected"' : "" }} >全部</option>
                <option value="1" {{app.request.get("cond").isIndex is defined and app.request.get("cond").isIndex == "1" ? ' selected="selected"' : "" }} >首页置顶</option>
            </select>
        </div>
    </div>
{% endblock %}
{% block tableHead %}
    <tr>
        <th width="6%">选择</th>
        <th align="left">标题</th>
        <th align="left" width="10%">浏览量</th>
        <th align="left" width="10%">更新时间</th>
        <th align="center" width="8%">首页置顶</th>
        <th align="center" width="5%">管理</th>
    </tr>
{% endblock %}
{% block tableList %}
    {% for Article in lists %}
        <tr>
            <td align="center">
                <span class="checkall" style="vertical-align:middle;">
                    <input type="checkbox" name="ids[]" value="{{ Article.id }}"/>
                </span>
            </td>
            <td align="left">{{ Article.title }}</td>
            <td align="left">{{ Article.count }}</td>
            <td align="left">{{ Article.updateTime | date("Y-m-d H:i:s") }}</td>
            <td align="center">
                <div class="btn-tools">
                    <a title="{{ Article.isIndex == 1 ? "取消" : "设置" }}首页置顶" class="top {{ Article.isIndex == 1 ? "selected" : "" }}" href="javascript:__doPostBack('setAttr','id={{ Article.id }}&isIndex={{ Article.isIndex == 1 ? 0 : 1 }}')"></a>
                </div>
            </td>
            <td align="center">
                <a href="{{ path("ArticlePreEdit",{'id':Article.id}) }}" class="img-btn edit"></a>
            </td>
        </tr>
    {% endfor %}
{% endblock %}
{% block script %}
    {#{% include 'AdminsBundle:base:inc.js.pic.upload.twig' %}#}
    {#{% include 'AdminsBundle:base:inc.js.article.twig' %}#}
    {#{% include 'AdminsBundle:base:inc.js.form.valid.twig' %}#}
    {#{% include 'AdminsBundle:base:inc.js.date.picker.twig' %}#}
{% endblock %}

